//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package commands;

import common.ByteStream;

public class FruitTreeBuy extends LogicCommand {
    final int cmdId = 4;
    final int buyType = -1;
    final int treeId;
    final int X;
    final int Y;
    final boolean mirrored;

    public FruitTreeBuy(int tt, int treeId, int X, int Y, boolean mirrored) {
        super(tt);
        this.treeId = treeId;
        this.X = X << 9;
        this.Y = Y << 9;
        this.mirrored = mirrored;
    }

    public int getCommandId() {
        return 4;
    }

    public void encode(ByteStream stream) {
        stream.writeInt(4);
        stream.writeInt(this.treeId);
        stream.writeInt(-1);
        stream.writeInt(this.X);
        stream.writeInt(this.Y);
        stream.writeBoolean(this.mirrored);
        stream.writeInt(this.ticksWhenTouch().intValue());
    }
}
